/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package com.xiashitech.agent.instrumentation.dubbo.common.inst.reentry;


import com.alibaba.dubbo.rpc.Result;
import io.opentelemetry.javaagent.shaded.io.opentelemetry.context.propagation.TextMapGetter;

public enum DubboReentryHeadersGetter implements TextMapGetter<Result> {
  INSTANCE;

  @Override
  public Iterable<String> keys(Result result) {
    return result.getAttachments().keySet();
  }

  @Override
  public String get(Result result, String key) {
    return result.getAttachment(key);
  }
}
